package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;

public class Indisponibilite implements Serializable {
	
	public static final int LUNDI = 0;
	public static final int MARDI = 1;
	public static final int MERCREDI = 2;
	public static final int JEUDI = 3;
	public static final int VENDREDI = 4;
	public static final int SAMEDI = 5;
	public static final int DIMANCHE = 6;
	
	public static final int MATIN = 0;
	public static final int APRES_MIDI = 1;
	
	private static final long serialVersionUID = 2709425132797014973L;

	private int numIndisponibilite;
	private int horaire;

    public Indisponibilite(int numIndisponibilite, int horaire, int jours, int degre) {
        this.numIndisponibilite = numIndisponibilite;
        this.horaire = horaire;
        this.jours = jours;
        this.degre = degre;
    }
	private int jours;
	private int degre;
	private Enseignant enseignant;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Indisponibilite() {}
	
	public Indisponibilite(int numIndisponibilite, int horaire, int jours,
			int degre, Enseignant enseignant) {
		super();
		this.numIndisponibilite = numIndisponibilite;
		this.horaire = horaire;
		this.jours = jours;
		this.degre = degre;
		this.enseignant = enseignant;
	}

	public int getNumIndisponibilite() {
		return numIndisponibilite;
	}

	public void setNumIndisponibilite(int numIndisponibilite) {
		this.numIndisponibilite = numIndisponibilite;
	}

	public int getHoraire() {
		return horaire;
	}

	public void setHoraire(int horaire) {
		this.horaire = horaire;
	}

	public int getJours() {
		return jours;
	}

	public void setJours(int jours) {
		this.jours = jours;
	}

	public int getDegre() {
		return degre;
	}

	public void setDegre(int degre) {
		this.degre = degre;
	}

	public Enseignant getEnseignant() {
		return enseignant;
	}

	public void setEnseignant(Enseignant enseignant) {
		this.enseignant = enseignant;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	}
}
